/*
<Copyright (C) 2011 Dru Moore>

This file is part of demorecorder.

vlc-remote is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

demorecorder is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with demorecorder.  If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui/QApplication>
#include <QDeclarativeView>
#include <QDeclarativeContext>
#include "qmlapplicationviewer.h"
#include "demorecorder.h"
#include <gst/gst.h>


int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    gst_init (&argc, &argv);

    QmlApplicationViewer viewer;

    QDeclarativeContext *context = new QDeclarativeContext(viewer.rootContext ());
    if (context->parentContext())
        context = context->parentContext();
    DemoRecorder *demorecorder = new DemoRecorder(0, context);

    context->setContextProperty("demoRecorderObject", demorecorder);

    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
    viewer.setMainQmlFile(QLatin1String("/opt/demorecorder/qml/qml/main.qml"));
    viewer.showFullScreen(); //showExpanded();

    return app.exec();
}
